<?php 
if($_SERVER["PHP_SELF"] != $CONFIG['phpself'])
exit();
?>

<div class='achdiv'>
<div class='cat'>
<?php
$GET_VAR_PART_MOINS_1 = $GET_VAR_PART - 1;
if($POST_VAR_PARTOFCREATION != 0)
{
	$i = $POST_VAR_PARTOFCREATION-1;
	if (stripslashes($_POST['typeofachievement'])!="none")
	{
		$_SESSION['partCreation'][$i] = 1;
	}
	else
	{
		for($i = $GET_VAR_PART_MOINS_1; $i < 6; $i++)
		{
			$_SESSION['AchTypeofAchievement'][$i] = "none";
			$_SESSION['partCreation'][$i] = 1;
		}
		$GET_VAR_PART_MOINS_1 = 5;
		$GET_VAR_PART = 6;
		$POST_VAR_PARTOFCREATION = 6;
	}
}
echo $ADMIN_MODIFIER_ACHIEVEMENT_TITLE[$Lang]; ?>
</div>
<table style="text-align: left; width: 100px;" border="0"
 cellpadding="2" cellspacing="10">
  <tbody>
    <tr>
	<?php 
if($POST_VAR_PARTOFCREATION != 7)
{
	if( $_SESSION['partCreation'][5] == 0 )
	{
	?>
      <td style="text-align: center;"><?php
	if( $_SESSION['partCreation'][0] == 0 )
		echo '<img src="images/part1off.png" alt="Not done">';
	else
		echo '<a href="'.$_SERVER['PHP_SELF'].'?page=modifier&part=0"><img src="images/part1on.png" alt="Done" style="border: 0 none;" ></a>';
	?></td><?php } ?>
      <td style="text-align: center;"><?php
	if( $_SESSION['partCreation'][1] == 0 )
		echo '<img src="images/part2off.png" alt="Not done">';
	else
		echo '<a href="'.$_SERVER['PHP_SELF'].'?page=modifier&part=1"><img src="images/part2on.png" alt="Done" style="border: 0 none;" ></a>';
	?>
		</td>
      <td style="text-align: center;"><?php
	if( $_SESSION['partCreation'][2] == 0 )
		echo '<img src="images/part3off.png" alt="Not done">';
	else
		echo '<a href="'.$_SERVER['PHP_SELF'].'?page=modifier&part=2"><img src="images/part3on.png" alt="Done" style="border: 0 none;" ></a>';
	?>
      </td>
      <td style="text-align: center;"><?php
	if( $_SESSION['partCreation'][3] == 0 )
		echo '<img src="images/part4offf.png" alt="Not done">';
	else
		echo '<a href="'.$_SERVER['PHP_SELF'].'?page=modifier&part=3"><img src="images/part4on.png" alt="Done" style="border: 0 none;" ></a>';
	?>
      </td>
      <td style="text-align: center;"><?php
	if( $_SESSION['partCreation'][4] == 0 )
		echo '<img src="images/part5off.png" alt="Not done">';
	else
		echo '<a href="'.$_SERVER['PHP_SELF'].'?page=modifier&part=4"><img src="images/part5on.png" alt="Done" style="border: 0 none;" ></a>';
	?></td>
	<?php if( $_SESSION['partCreation'][5] == 1 )
	{
	?>
      <td style="text-align: center;"><?php 
	if( $_SESSION['partCreation'][5] == 0 )
		echo '<img src="images/part6off.png" alt="Not done">';
	else
		echo '<a href="'.$_SERVER['PHP_SELF'].'?page=modifier&part=5"><img src="images/part6on.png" alt="Done" style="border: 0 none;" ></a>';
	?>
      </td><?php } ?>
    </tr>
    <tr>
      <?php if( $_SESSION['partCreation'][5] == 0 ) { ?><td style="text-align: center;"><?php if($GET_VAR_PART == 0)
	  {
		echo $ADMIN_MODIF_ACHIEVEMENT_PART1[$Lang]; 
	  }?></td><?php } ?>
      <td style="text-align: center;"><?php if($GET_VAR_PART == 1)
	  {
		echo $ADMIN_MODIF_ACHIEVEMENT_PART2[$Lang]; 
	  }?><br/>
      </td>
      <td style="text-align: center;"><?php if($GET_VAR_PART == 2)
	  {
		echo $ADMIN_MODIF_ACHIEVEMENT_PART3[$Lang]; 
	  }?><br/>
      </td>
      <td style="text-align: center;"><?php if($GET_VAR_PART == 3)
	  {
		echo $ADMIN_MODIF_ACHIEVEMENT_PART4[$Lang]; 
	  }?><br>
      </td>
      <td style="text-align: center;"><?php if($GET_VAR_PART == 4)
	  {
		echo $ADMIN_MODIF_ACHIEVEMENT_PART5[$Lang]; 
	  }?><br/>
      </td>
	  <?php 
	  if( $_SESSION['partCreation'][5] == 1 ) 
	  { ?><td style="text-align: center;"><?php 
	  if($GET_VAR_PART == 5)
	  {
		echo $ADMIN_MODIF_ACHIEVEMENT_PART6[$Lang]; 
	  }?><br/>
      </td><?php 
	  }
}
else
{?>
 <td style="text-align: center;">
 <img src="images/succesachievement.png" alt="Finish">
 </td>
<?php 
} ?>
    </tr>
  </tbody>
</table>
<div class="achievementProgressBarfinish">
<big><big><big><big>
<?php 
if($POST_VAR_PARTOFCREATION != 7)
{ 
	echo $ADMIN_MODIF_ACHIEVEMENT_ENCOURS_ENDPART[$Lang];
}
else
{
	echo $ADMIN_MODIF_ACHIEVEMENT_ENDPART[$Lang];
}	
?></big></big></big></big>&nbsp; &nbsp; <a href="<?php echo $_SERVER['PHP_SELF']; ?>?deleteAch=1"><img src="images/deleteAch.png" style="border: 0 none;" alt="Delete all"></a>
</div>
<br/>
<?php
if($POST_VAR_PARTOFCREATION == 0 || ($GET_VAR_PART == 0))
{
	include 'partone.php';
}
elseif ($POST_VAR_PARTOFCREATION == 1 || ($_SESSION['partCreation'][$GET_VAR_PART]==1 && $GET_VAR_PART == 1))
{
	if($POST_VAR_PARTOFCREATION == 1)
	{
		$_SESSION['AchId'] 			= str_replace("'","''",stripslashes($_POST['id']));
		$_SESSION['AchTitle'] 		= str_replace("'","''",stripslashes($_POST['title']));
		$_SESSION['AchDesc']  		= stripslashes($_POST['descr']);
		$_SESSION['AchCat']   		= stripslashes($_POST['category']);
		$_SESSION['Achimage']   	= stripslashes($_POST['image']);
		$_SESSION['Achamount']   	= stripslashes($_POST['amount']);
		if (stripslashes($_POST['onelife']) != "1" ) 
			$_SESSION['Achonelife']  	= stripslashes($_POST['oneround']) ;
		else
			$_SESSION['Achonelife']  	= stripslashes($_POST['onelife']);	
		$_SESSION['Achtaunt']  		= stripslashes($_POST['taunt']);
		if($_POST['timemin']!="-1")
			$minute	 				= intval($_POST['timemin'])*60;
		else
			$minute = 0;
		if($_POST['timesec']!="-1")
			$second 				= intval($_POST['timesec']);
		else
			$second = -1;
		$_SESSION['Achtime']  		= $minute + $second;
	}
	include 'parttwo.php';
}
elseif (($POST_VAR_PARTOFCREATION > 1 && $POST_VAR_PARTOFCREATION < 6 ) || ($_SESSION['partCreation'][$GET_VAR_PART]==1 && ($GET_VAR_PART > 1 && $GET_VAR_PART < 6)))
{
	if($POST_VAR_PARTOFCREATION > 1)
	{
		$_SESSION['AchIdTwo'][$GET_VAR_PART_MOINS_1] 					= stripslashes($_POST['id']);
		$_SESSION['AchTypeofAchievement'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['typeofachievement']);
		//Kill
		$_SESSION['AchWhoWinKill'][$GET_VAR_PART_MOINS_1] 		 		= stripslashes($_POST['B1']);
		$_SESSION['AchKillVictimSteamIDText'][$GET_VAR_PART_MOINS_1] 	= stripslashes($_POST['killVictimSteamIDText']);
		$_SESSION['AchKillAttackSteamIDText'][$GET_VAR_PART_MOINS_1] 	= stripslashes($_POST['killAttackSteamIDText']);
		$_SESSION['AchKillAssistSteamIDText'][$GET_VAR_PART_MOINS_1] 	= stripslashes($_POST['killAssistSteamIDText']);
		$_SESSION['AchKillWeapon'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['killWeapon']);
		$_SESSION['AchKillMap'][$GET_VAR_PART_MOINS_1] 					= stripslashes($_POST['killMap']);
		$_SESSION['AchKillVictimclass'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['killVictimclass']);
		$_SESSION['AchKillAttackclass'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['killAttackclass']);
		$_SESSION['AchKillAssistclass'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['killAssistclass']);
		$_SESSION['AchKillCritz'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['B4']);
		$_SESSION['AchKillDomination'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['B8']);
		$_SESSION['AchKillRevenge'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['B9']);
		$_SESSION['AchKillHeadShot'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['B10']);
		$_SESSION['AchKillBackstab'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['B11']);
		$_SESSION['AchKillDeadRinger'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['B12']);
		$_SESSION['AchKillAmount'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['killAmount']);
		$_SESSION['AchEngineerObjectName1'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['engineerobjectname1']);
		$_SESSION['AchEngineerDestroyBuild1'][$GET_VAR_PART_MOINS_1]	= stripslashes($_POST['engineerdetroybuild1']);		//Sniper
		$_SESSION['AchSniperJarateRazor'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['sniperJarateRazor']);
		$_SESSION['AchSniperAttackVictim'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['sniperAttackVictim']);
		$_SESSION['AchSniperVictimSteamID'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['sniperVictimSteamID']);
		$_SESSION['AchSniperAmount'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['sniperAmount']);
		//Engineer
		$_SESSION['AchEngineerChoose'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['engineerChoose']);
		$_SESSION['AchEngineerObjectName'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['engineerobjectname']);
		$_SESSION['AchEngineerDestroy'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['engineerdetroy']);
		$_SESSION['AchEngineerDestroyBuild'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['engineerdetroybuild']);
		$_SESSION['AchEngineerOwnerSteamID'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['engineerowner_id']);
		$_SESSION['AchEngineerUserSteamID'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['engineeruser_id']);
		$_SESSION['AchEngineerUserClass'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['engineeruser_class']);
		$_SESSION['AchEngineerSelfUse'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['engineerselfuse']);
		$_SESSION['AchEngineerAmount'][$GET_VAR_PART_MOINS_1] 			= stripslashes($_POST['engineerAmount']);
		//Fun
		$_SESSION['AchFunRadio'][$GET_VAR_PART_MOINS_1]		 			= stripslashes($_POST['funradio']);
		$_SESSION['AchMapFun'][$GET_VAR_PART_MOINS_1]		 			= stripslashes($_POST['mapfun']);
		$_SESSION['AchFunRadioExact'][$GET_VAR_PART_MOINS_1]		 	= stripslashes($_POST['funradioexact']);
		$_SESSION['AchFunSayValue'][$GET_VAR_PART_MOINS_1]		 		= stripslashes($_POST['funtext']);
		$_SESSION['AchFunAmount'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['funAmount']);
		
		//Heavy
		$_SESSION['AchHeavySandwitch'][$GET_VAR_PART_MOINS_1]		 	= stripslashes($_POST['heavysandwitch']);
		$_SESSION['AchHeavySandwitchSteal'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['heavysandwitchvicattack']);
		$_SESSION['AchHeavyAmount'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['heavyAmount']);
		//Hurt
		$_SESSION['AchWhoWinHurt'][$GET_VAR_PART_MOINS_1] 		 		= stripslashes($_POST['HurtB1']);
		$_SESSION['AchHurtAttackerSteamIDText'][$GET_VAR_PART_MOINS_1] 	= stripslashes($_POST['HurtAttackerSteamIDText']);
		$_SESSION['AchHurtVictimSteamIDText'][$GET_VAR_PART_MOINS_1] 	= stripslashes($_POST['HurtVictimSteamIDText']);
		$_SESSION['AchHurtCritz'][$GET_VAR_PART_MOINS_1]			 	= stripslashes($_POST['HurtB4']);
		$_SESSION['AchHurtDmg_min'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['HurtDmg_min']);
		$_SESSION['AchHurtDmg_max'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['HurtDmg_max']);
		$_SESSION['AchHurtSelfdmg'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['HurtB5']);
		$_SESSION['AchHurtMap'][$GET_VAR_PART_MOINS_1]					= stripslashes($_POST['HurtMap']);
		$_SESSION['AchHurtAttacker_class'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['HurtAttacker_class']);
		$_SESSION['AchHurtVictim_class'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['HurtVictim_class']);
		$_SESSION['AchHurtAmount'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['HurtAmount']);
		//MAP
		$_SESSION['AchWhoWinTeamMap'][$GET_VAR_PART_MOINS_1] 		 	= stripslashes($_POST['MapB1']);
		$_SESSION['AchMapCaperSteamIDText'][$GET_VAR_PART_MOINS_1] 		= stripslashes($_POST['MapCaperSteamIDText']);
		$_SESSION['AchMapName'][$GET_VAR_PART_MOINS_1] 					= stripslashes($_POST['Mapmap']);
		$_SESSION['AchMapNumberOfPoint'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['MapNumberOfPoint']);
		$_SESSION['AchMapMinCaper'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['MapMinCaper']);
		$_SESSION['AchMapMaxCaper'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['MapMaxCaper']);
		$_SESSION['AchMapCapturerClass'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['MapCapturerClass']);
		$_SESSION['AchMapAmount'][$GET_VAR_PART_MOINS_1] 				= stripslashes($_POST['MapAmount']);
		//MEDIC
		$_SESSION['AchMedicWho'][$GET_VAR_PART_MOINS_1]	 		 		= stripslashes($_POST['medicwho']);
		$_SESSION['AchMedicUber'][$GET_VAR_PART_MOINS_1]	 		 	= stripslashes($_POST['uberGroup']);
		$_SESSION['AchMedicAssistSteamID'][$GET_VAR_PART_MOINS_1]	 	= stripslashes($_POST['medicAssistSteamID']);
		$_SESSION['AchMedicAmount'][$GET_VAR_PART_MOINS_1]	 		 	= stripslashes($_POST['MedicAmount']);
		//Scout
		$_SESSION['AchScoutAchievements'][$GET_VAR_PART_MOINS_1]	 	= stripslashes($_POST['scoutAchievements']);
		$_SESSION['AchScoutAchievementsStunt'][$GET_VAR_PART_MOINS_1]	= stripslashes($_POST['scoutAchievementsStunt']);
		$_SESSION['AchScoutVictimSteamID'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['scoutStuntVictimSteamID']);
		$_SESSION['AchScoutAmount'][$GET_VAR_PART_MOINS_1]				= stripslashes($_POST['ScoutAmount']);
		//Condition
		$_SESSION['AchConditonWho'][$GET_VAR_PART_MOINS_1]				= stripslashes($_POST['B1Condition']);
		$_SESSION['AchB2Conditon'][$GET_VAR_PART_MOINS_1]				= stripslashes($_POST['B2Conditon']);
		$_SESSION['AchB2ConditonChapeau'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['B2ConditonChapeau']);
		$_SESSION['AchB2ConditonHealth1'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['B2ConditonHealth1']);
		$_SESSION['AchB2ConditonHealth2'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['B2ConditonHealth2']);
		$_SESSION['AchB2ConditonDistance1'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['B2ConditonDistance1']);
		$_SESSION['AchB2ConditonDistance2'][$GET_VAR_PART_MOINS_1]		= stripslashes($_POST['B2ConditonDistance2']);
		//Demoman
		$_SESSION['AchDemomanAmount'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['demomanAmount']);
		//Soldier
		$_SESSION['AchSoldierAction'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['soldieraction']);
		$_SESSION['AchSoldierAmount'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['soldierAmount']);
		//Spy
		$_SESSION['AchSpyWho'][$GET_VAR_PART_MOINS_1]					= stripslashes($_POST['spywho']);
		$_SESSION['AchSpyObjectName'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['spyobjectname']);
		$_SESSION['AchSpyVictimSteamID'][$GET_VAR_PART_MOINS_1]			= stripslashes($_POST['spyVictimSteamID']);
		$_SESSION['AchSpyAmount'][$GET_VAR_PART_MOINS_1]				= stripslashes($_POST['spyAmount']);
	}
	include 'parttwo.php';
}
elseif ($POST_VAR_PARTOFCREATION == 6 || ($_SESSION['partCreation'][$GET_VAR_PART_MOINS_1]==1 && $GET_VAR_PART == 6))
{
	include 'confpart.php';
}
elseif ($POST_VAR_PARTOFCREATION == 7)
{
	include 'modifpart.php';
}
?><br/><br/>
</div>
